<div class="listArea l">
  <div class="grybox">
    <h3>User List - <?php echo $merchant->getName(); ?></h3>

    <?php include_partial('global/pager', array('pager' => $pager, 'sort' => array(MerchantUserForm::SORT_FIRST_NAME => 'First Name', MerchantUserForm::SORT_LAST_NAME => 'Last Name', MerchantUserForm::SORT_CREATED_AT => 'Created Date'))) ?>

    <div class="listBox" style="clear:both;">
      <div class="listWarp1">Name</div>
      <div class="listWarp1">Email</div>
      <div class="listWarp3">Type</div>
    </div>
    <div class="listBoxWht">
      <?php if ($pager->getNbResults()) : ?>
      <?php foreach ($pager->getResults() as $user) : ?>
      <div class="frmRow<?php if ($user->getStatus() == Constants::STATUS_INACTIVE) : ?> frmRowInactive<?php endif; ?>">
        <div class="listWarp1"><?php echo $user->getFirstName(); ?> <?php echo $user->getLastName(); ?></div>
        <div class="listWarp1"><?php echo $user->getUsername(); ?></div>
        <div class="listWarp3"><?php $arr = StringUtil::getAccountTypeArray(); echo $arr[$user->getUserGroupId()]; ?></div>
        <div class="editWarp"><a href="<?php echo url_for('@user_edit?id=' . $user->getId()); ?>#f">Edit</a></div>
      </div>
      <?php endforeach; ?>
      <?php endif; ?>
    </div>

    <div class="fcnLinks">
        <?php echo link_to('Back to Merchants', '@merchant_add', array('class'=>'icoBack'))?>
    </div>
  </div>
</div>


<form class="f" action="?#f" method="POST">
  <div class="grybox">
    <h1><?php if (isset($isEdit)) : ?>Edit<?php else : ?>Add<?php endif; ?> User</h1>
    <div class="fmArea">
      <?php echo include_partial('global/errorsList', array('forms' => array($form), 'global' => $errorCollector)); ?>
      <?php if ($sf_request->hasParameter('success')) : ?><div class="succDis"><?php echo LangUtil::getText('message_save_success'); ?></div><?php endif; ?>
      <div class="singleColumn">

        <h2></h2>
        <div class="frmRow">
          <?php echo $form[MerchantUserForm::FIELD_MERCHANT_ID]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[MerchantUserForm::FIELD_MERCHANT_ID]->render(); ?><input type="text" class="txtBox1" value="<?php echo $merchant->getName(); ?>" readonly="readonly" /></div>
        </div>
        <div class="frmRow">
          <?php echo $form[MerchantUserForm::FIELD_FIRST_NAME]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[MerchantUserForm::FIELD_FIRST_NAME]->render(array('class'=>'txtBox1')); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[MerchantUserForm::FIELD_LAST_NAME]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[MerchantUserForm::FIELD_LAST_NAME]->render(array('class'=>'txtBox1')); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[MerchantUserForm::FIELD_EMAIL]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[MerchantUserForm::FIELD_EMAIL]->render(array('class'=>'txtBox1', 'readonly' => (isset($isEdit) ? 'readonly' : ''))); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[MerchantUserForm::FIELD_TYPE]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[MerchantUserForm::FIELD_TYPE]->render(array('class'=>'drpBox1')); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[MerchantForm::FIELD_STATUS]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[MerchantForm::FIELD_STATUS]->render(array('class'=>'drpBox1')); ?></div>
        </div>
      </div>

      <div class="butArea">
        <input name="" type="submit" class="buttnSrh11" value="Save Changes" />
      </div>

      <div class="fcnLinks">
          <?php echo link_to('Back to Merchants', '@merchant_add', array('class'=>'icoBack'))?>
      </div>
    </div>
  </div>
  <?php echo $form['_csrf_token']->render(); ?>
</form>